<template>
	<view>
		<view class="flex flex-y flex-y-center pr"
			style="width: 559rpx;height: 933rpx;background:  url(@/static/my/invite.png) left top / 100% 100%;margin: 100rpx auto 0 auto;">
			<view style="position: absolute;left:50%;transform: translateX(-50%);text-align: center;top:180rpx;">
				<view>
					<view
						style="width: 160rpx;height: 160rpx;border-radius: 20rpx;overflow: hidden;margin: auto;">
						<qq-image :url="faceurl" style="width: 100%;height: 100%;"></qq-image>
					</view>
					<view style="margin-top: 20rpx;text-align: center;font-size: 30rpx;font-weight: 600;">群聊：{{groupname}}</view>
				</view>
				<view style="width: 300rpx;height: 300rpx;margin-top: 50rpx;">
					<qq-image :url="qrcode" imageStyle="width:100%;height:100%;"></qq-image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusbar: getApp().globalData.statusBar + 'px',
				qrcode: '',
				userid:'',
				groupname:'',
				faceurl:''
			};
		},

		onLoad(e) {
			console.log('eeeee',e)
			const groupID = e["groupID ".trim()]; // 清除键名中的空格后访问
			this.groupname = e.groupname
			this.faceurl = e.faceurl
			this.userid = groupID
			this.getqrcode();
		},


		methods: {
			getqrcode() {
				let inviteobj = {
					userid:this.userid,
					type:'group'
				}
				let jsoninvite = JSON.stringify(inviteobj);
				this.request({
					url: '/chat/createQrcode',
					method: 'POST',
					// data: this.ROOT + '/chat/getDownloadPage?invite=' + this.userid
					data: this.ROOT + '/chat/getDownloadPage?invite=' + jsoninvite
				}).then(res => {
					if (res.status != 200) return;
					if (res.data) {
						this.qrcode = res.data;
					}
				});
			}
		},
	}
</script>